package com.design.springboot.booksharing.service.impl;

import com.design.springboot.booksharing.bean.BookClassification;
import com.design.springboot.booksharing.bean.QueryWarp;
import com.design.springboot.booksharing.bean.vo.BookClassificationVo;
import com.design.springboot.booksharing.dao.BookClassificationDao;
import com.design.springboot.booksharing.service.BookClassificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 书籍分类信息(BookClassification)表服务实现类
 *
 * @author admin
 */
@Service("bookClassificationService")
public class BookClassificationServiceImpl implements BookClassificationService {
    @Resource
    private BookClassificationDao bookClassificationDao;

    @Override
    public Boolean saveBookClassification(BookClassification bookClassification) {
        return bookClassificationDao.saveBookClassification(bookClassification) > 0;
    }

    @Override
    public Boolean deleteBookClassification(Integer id) {
        return bookClassificationDao.deleteBookClassification(id) > 0;
    }

    @Override
    public Boolean updateBookClassification(BookClassification bookClassification) {
        return bookClassificationDao.updateBookClassification(bookClassification) > 0;
    }

    @Override
    public BookClassification getBookClassificationById(Integer id) {
        return bookClassificationDao.getBookClassificationById(id);
    }

    @Override
    public List<BookClassification> listBookClassification(QueryWarp<BookClassification> queryWarp) {
        return bookClassificationDao.listBookClassification(queryWarp);
    }

    @Override
    public List<BookClassificationVo> bookClassificationTreeVo(){
        return bookClassificationDao.bookClassificationTreeVo();
    }
}
